package com.sunnuwell.demo.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @program: entry
 * @description: 用户实体类
 * @author: Mr.lv
 * @create: 2019-04-24 10:43
 **/

/**
 * 实体类，类名对应的是MongoDB的集合名（表名），若没有，则自动创建
 * @author asusaad
 *
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class EquipmentVo {

    private String eid;
    // 厂商
    private String manufacturer;
    // 型号
    private String model;
    // SN
    private String sn;
    // MAC
    private String mac;
    // version
    private String version;
    // status 在线状态
    private Integer status;
    // createdTime 创建时间
    private String createdTime;
    // activeTime 活跃开始时间
    private String startTime;
    // activeTime 活跃结束时间
    private String endTime;
    // description 描述
    private String description;
    // 分页相关
    private Integer pageNumber;
    private Integer pageSize;

    public Boolean validate() {
        return manufacturer != null && model != null && sn != null
                && mac != null && version != null && status != null
                && createdTime != null && startTime != null && endTime != null && description != null;
    }

    // 判断id是否存在
    public Boolean validateEid() {
        return eid != null;
    }

    public boolean validateSearch() {

        return pageNumber != null && pageNumber != 0 && pageSize != null && pageSize != 0;
    }


}